﻿@namespace LaserMark.Components.Components
@inject IDBManager DBManager

<div class="photoelectricity">
    <ValidateForm ShowLabel="false" Model="@Model" @ref="ValidateForm">
        <div class="row g-3 form-inline">
            <div class="col-12">
                <RadioList @bind-Value="Model.ScanType" DisplayText="扫描方式" ShowLabel="true" Items="@TypeItems"></RadioList>
                <label class="form-label ms-2"></label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.LightOffsetX" Step="0.01" DisplayText="光电管偏移X" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">mm</label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.LightOffsetY" Step="0.01" DisplayText="光电管偏移Y" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">mm</label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.ScanPoint1" DisplayText="扫描X轴第一点" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">%</label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.ScanPoint2" DisplayText="扫描X轴第二点" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">%</label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.ScanSinglePoint" DisplayText="扫描Y轴（单点）" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">%</label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.XRange" DisplayText="X方向移动距离" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">mm</label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.YRange" DisplayText="Y方向移动距离" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">mm</label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.ScanMaxX" DisplayText="扫描移动最大距离X" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">mm</label>
            </div>
            <div class="col-6">
                <BootstrapInputNumber @bind-Value="Model.ScanMaxY" DisplayText="扫描移动最大距离Y" ShowLabel="true"></BootstrapInputNumber>
                <label class="form-label ms-2">mm</label>
            </div>
            @if (Model.ScanType == "1")
            {
                <div class="row g-3 mt-3 form-inline">
                    <div class="col-6">
                        <BootstrapInputNumber @bind-Value="Model.Height1" DisplayText="定点X" ShowLabel="true"></BootstrapInputNumber>
                        <label class="form-label ms-2">mm</label>
                    </div>
                    <div class="col-6">
                        <BootstrapInputNumber @bind-Value="Model.Height2" DisplayText="定点Y" ShowLabel="true"></BootstrapInputNumber>
                        <label class="form-label ms-2">mm</label>
                    </div>
                </div>
            }
        </div>
    </ValidateForm>
</div>

<DialogFooter OnSave="@OnSave"></DialogFooter>
